Skip to content

Fix issue 1255 - #1372

Open
S-Bhattacharya240611 wants to merge 3 commits into
rzellem:developfrom
S-Bhattacharya240611:fix-issue-1255
Open

Fix issue 1255#1372
S-Bhattacharya240611 wants to merge 3 commits into
rzellem:developfrom
S-Bhattacharya240611:fix-issue-1255

Conversation

@S-Bhattacharya240611

Copy link
Copy Markdown

This PR resolves Issue #1255 by implementing a coordinate-based fallback for the Field of View (FOV) plot.
The Problem:
When the NASAExoplanetArchive query fails (due to target omission, candidate status, or API instability), the pipeline currently fails to generate the FOV plot because of missing coordinates in pDict.
The Solution:
I have implemented a logic bridge in exotic/exotic.py that checks for user-provided RA and DEC values in userpDict (from inits.json) if the NASA Archive lookup returns empty.
Safety Features:
Utilizes .get() for safe dictionary access.
Includes a secondary check to prevent NoneType crashes if both the Archive and the user-input are missing.
Added logging to notify the user when a fallback is active.
Testing:
Verified syntax via py_compile.
Passed all 45 existing unit tests (test_ld.py and test_utils.py) using pytest on Python 3.12.
Resolves #1255

@rzellem

rzellem commented Mar 26, 2026

Copy link
Copy Markdown
Owner

Have you tested to see if this works as intended if a user does not supply an inits.json file?

@S-Bhattacharya240611

S-Bhattacharya240611 commented Mar 26, 2026

Copy link
Copy Markdown
Author

Have you tested to see if this works as intended if a user does not supply an inits.json file?

Hi Dr. Zellem , I have performed a regression test on the interactive (non-JSON) workflow to verify the fix.
During testing, I identified that planet_info() returns None for candidate planets in interactive mode, which originally caused an AttributeError in my fallback logic. I have updated the implementation to:
Safely initialize pDict as an empty dictionary if the archive returns None.
Successfully perform the RA/DEC fallback from userpDict for both JSON and manual entries.
Verified the fix by passing the full pytest suite (45/45) on Python 3.12.
This ensures the FOV plot is now robust across all input methods.And as always, thank you for the guidance!
The issue is fixed and tested

@opusbuilds

Copy link
Copy Markdown

Executed review, 2026-08-22 (part of the open-PR triage Rob asked me to run; evidence only, decisions stay with maintainers).

What it does: when the NASA Exoplanet Archive query returns no usable coordinates (candidate targets, omissions, API failures), falls back to the inits.json RA/DEC so the FOV plot can still be generated (issue #1255).

Static assessment: the direction is right and the issue is real. Three things before merge:

  1. Sparse-pDict scope — after the patch, a failed archive query yields pDict containing only ra/dec. That rescues the FOV plot, but everything downstream that expects period/priors still sees an empty dict. Was this tested end-to-end on a real candidate target (the Fall back to RA+DEC on Colab for FOV Plot #1255 scenario), and does the run complete rather than fail later? A one-line answer with the target name you tested would settle it.
  2. Comment hygiene# --- V2 SOTA FALLBACK (FIXED FOR CANDIDATES) --- describes the patch's history, not the code. Suggest replacing with a comment saying why (archive can omit candidates; FOV plot needs coords from somewhere).
  3. The magic branch (Large update for Speed, Robustness and Pre-reduced focussed updates.  #1373) has rebuilt this exact region — it now guards isinstance(pDict, dict), keeps an archive_planet_dict, and does archive↔inits coordinate recovery in both directions (exotic.py ~32479–32530). This patch won't apply there, and the Fall back to RA+DEC on Colab for FOV Plot #1255 failure may already be fixed on that branch. Worth one test of the Fall back to RA+DEC on Colab for FOV Plot #1255 scenario against Large update for Speed, Robustness and Pre-reduced focussed updates.  #1373 before deciding whether this merges to develop as a stopgap or closes as superseded.

Recommendation: iterate (answer 1, clean 2), and run the scenario on #1373 — if the magic branch already handles it, close as superseded with the issue cross-referenced; if not, this is a reasonable develop-side stopgap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants